﻿using System;
using System.Collections.Generic;
using System.Text;

using ESRI.ArcGIS.ADF.BaseClasses;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Geometry;

namespace SZ
{
    public sealed class IdentifyClass : BaseTool
    {
        private AxMapControl m_AxMapControl = null;
        private MainFrm m_MainFrm = null;

        public IdentifyClass(MainFrm mainFrm, AxMapControl axMapControl)
        {
            m_AxMapControl = axMapControl;
            m_MainFrm = mainFrm;
        }

        #region Override Class Methods
        public override void OnCreate(object hook)
        {
            base.m_cursor = System.Windows.Forms.Cursors.Help;

        }

        public override void OnClick()
        {
        }

        //框选识别要素怎么办？
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            
            if (Button == 1)
            {
                if (PublicVariablesClass.m_Identify == null)
                {
                    PublicVariablesClass.m_Identify = IdentifyFrm.Instance(m_AxMapControl);
                    PublicVariablesClass.m_Identify.Owner = m_MainFrm;
                    PublicVariablesClass.m_Identify.Show();
                }


                IPoint pPointIdentify = m_AxMapControl.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
                PublicVariablesClass.m_Identify.GetInformation(pPointIdentify);
         
            }
        }

        public override void OnMouseMove(int Button, int Shift, int X, int Y)
        {

        }

        public override void OnMouseUp(int Button, int Shift, int X, int Y)
        {

        }
        #endregion
    }
}
